Skip to content

Logger abstraction added#159

Open
Reversean wants to merge 1 commit intorefactor/user-managerfrom
refactor/catcher-logger
Open

Logger abstraction added#159
Reversean wants to merge 1 commit intorefactor/user-managerfrom
refactor/catcher-logger

Conversation

@Reversean
Copy link
Member

@Reversean Reversean commented Feb 12, 2026

Related #151

Added env-agnostic Logger abstraction.

Also added global singleton loggerInstance which could be set via setLogger and used via log methods.

Also added browser-specific logger factory-method createBrowserLogger which may be used as Logger.

@Reversean Reversean changed the title refactor(core): UserManager abstraction added UserManager abstraction added Feb 12, 2026
@Reversean Reversean changed the title UserManager abstraction added Logger abstraction added Feb 12, 2026
@Reversean Reversean marked this pull request as draft February 12, 2026 18:36
@Reversean Reversean force-pushed the refactor/catcher-logger branch from 6d66554 to 0ca5710 Compare February 12, 2026 18:49
@Reversean Reversean force-pushed the refactor/user-manager branch 2 times, most recently from 37eecbd to 70760fd Compare February 12, 2026 19:44
@Reversean Reversean force-pushed the refactor/catcher-logger branch from 0ca5710 to 4ad2b5f Compare February 12, 2026 19:45
@Reversean Reversean force-pushed the refactor/user-manager branch 5 times, most recently from a0132ff to 9a60f23 Compare February 16, 2026 22:22
@Reversean Reversean force-pushed the refactor/catcher-logger branch from 4ad2b5f to 9c05fec Compare February 16, 2026 22:23
@Reversean Reversean force-pushed the refactor/user-manager branch from 9a60f23 to eacefe1 Compare February 16, 2026 22:27
@Reversean Reversean force-pushed the refactor/catcher-logger branch from 9c05fec to 53f65cb Compare February 16, 2026 22:30
@Reversean Reversean marked this pull request as ready for review February 16, 2026 22:31
@Reversean Reversean force-pushed the refactor/catcher-logger branch from 53f65cb to 99bbc51 Compare February 16, 2026 22:41
@Reversean Reversean force-pushed the refactor/user-manager branch from eacefe1 to 7d5e8e4 Compare February 17, 2026 13:40
@Reversean Reversean force-pushed the refactor/catcher-logger branch 2 times, most recently from 8b30a3c to 202e102 Compare February 17, 2026 13:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces an environment-agnostic logger abstraction to support the architectural refactoring described in issue #151. The implementation separates core logging functionality from browser-specific implementation details, setting the foundation for a cleaner package structure that will enable code reuse across different JavaScript environments (Node.js, Nuxt, etc.).

Changes:

  • Added core logger abstraction (Logger interface, LogType, setLogger(), log()) to @hawk.so/core
  • Migrated browser-specific logger from utils/log.ts to logger/logger.ts as a factory function
  • Updated all imports across the codebase to use the new logger from @hawk.so/core

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
packages/core/src/logger/logger.ts Defines environment-agnostic Logger interface, LogType, and global logger singleton with setLogger/log functions
packages/core/src/index.ts Exports Logger, LogType, setLogger, and log from core package
packages/javascript/src/logger/logger.ts Browser-specific logger implementation as factory function createBrowserLogger
packages/javascript/src/catcher.ts Initializes logger in constructor; minor formatting improvements to object destructuring
packages/javascript/src/utils/log.ts Removed old browser-specific logger implementation
packages/javascript/src/utils/validation.ts Updated to import log from @hawk.so/core
packages/javascript/src/utils/event.ts Updated to import log from @hawk.so/core
packages/javascript/src/modules/socket.ts Updated to import log from @hawk.so/core
packages/javascript/src/modules/fetchTimer.ts Updated to import log from @hawk.so/core
packages/javascript/src/addons/breadcrumbs.ts Updated to import log from @hawk.so/core
packages/javascript/tests/logger/logger.test.ts Comprehensive tests for browser logger implementation
packages/javascript/tests/breadcrumbs.test.ts Updated to spy on core log function instead of console.warn

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Reversean Reversean force-pushed the refactor/user-manager branch 2 times, most recently from fb57118 to 77fb17d Compare February 18, 2026 17:54
@Reversean Reversean force-pushed the refactor/catcher-logger branch from 202e102 to 924fa12 Compare February 22, 2026 14:17
@Reversean Reversean force-pushed the refactor/user-manager branch from 77fb17d to 7c596c5 Compare February 22, 2026 14:48
@Reversean Reversean force-pushed the refactor/catcher-logger branch from f99d5fe to 173d40e Compare February 22, 2026 14:51
@Reversean Reversean force-pushed the refactor/user-manager branch from 7c596c5 to d0c4bff Compare February 25, 2026 17:24
@Reversean Reversean force-pushed the refactor/catcher-logger branch 2 times, most recently from 1cb3077 to 70d214e Compare February 25, 2026 17:35
@Reversean Reversean force-pushed the refactor/catcher-logger branch from 70d214e to fc05da3 Compare March 4, 2026 18:12
@Reversean Reversean force-pushed the refactor/user-manager branch from 798f237 to 88436ca Compare March 5, 2026 08:49
@Reversean Reversean force-pushed the refactor/catcher-logger branch from fc05da3 to 8ad3d96 Compare March 5, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants